create external table jms_dm.dm_customer_changes_week_dt (
             date_type string comment '日、周、月',
             customer_level string comment '客户等级',           --
             ordersource_code string comment '客户平台ID',         --
             ordersource_name string comment '平台名字',  --
             subordinate_agent_code string comment '客户所属代理区code',  --
             subordinate_agent_name string comment '客户所属代理区名字',  --
             first_franchisee_code string comment '客户所属加盟商code',
             first_franchisee_name string comment '客户所属加盟商名字',
             customer_belong_network_id string comment '客户所属网点ID',  --
             customer_belong_network_name string comment '客户所属网点名字',  --
             customer_cnt bigint comment '等级发件客户个数',
             today_customer_cnt bigint comment '总发件客户个数',
             customer_cnt_rate decimal(16,4) comment '客户占比',
             last_week_customer_cnt bigint comment '上周发件客户个数',
             week_customer_waybill_sum bigint comment '等级发件客户运单总量',--
             today_week_customer_waybill_sum bigint comment '总发件客户运单总量',
             customer_waybill_rate decimal(16,4) comment '运单占比',
             customer_up_rate decimal(16,4) comment '客户提升率',  --
             new_cnt bigint comment '新增客户数',      --
             new_customer_waybill_sum bigint comment '新增客户运单总量',  --
             new_customer_rate decimal(16,4) comment '新增客户率',  --
             loss_cnt bigint comment '流失客户数',   --
             loss_waybill_sum bigint comment '流失客户运单总量',  --
             loss_customer_rate decimal(16,4) comment '流失客户率',
             retrieve_cnt bigint comment '挽回客户数',  --
             retrieve_waybill_sum  bigint comment '挽回客户运单总量',
             retrieve_customer_rate  decimal(16,4) comment '挽回率',
             dt2 STRING COMMENT '日期',
             org_level2 string comment  '网点、加盟商、代理区'
)
    COMMENT  '客户异动周数据'
    PARTITIONED BY ( dt STRING COMMENT '日期',org_level string comment  '网点、加盟商、代理区')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_customer_changes_week_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );